import App from './App'

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
//引入执行mock 一次
import '@/mock/mockServe'

import {
  createSSRApp
} from 'vue'
import {
  createUnistorage
} from './uni_modules/pinia-plugin-unistorage'
import * as Pinia from 'pinia';
import io from '@hyoga/uni-socket.io';
export function createApp() {
  const app = createSSRApp(App);
  const store = Pinia.createPinia();
  store.use(createUnistorage());
  app.use(store);
  //服务器地址
  app.config.globalProperties.serverUrl = 'http://192.168.3.13:3001'
  //引入socket模块
  app.config.globalProperties.socket = io('http://192.168.3.13:8082', {
    query: {},
    transports: ['websocket', 'polling'],
    timeout: 5000,
  })

  return {
    app,
    Pinia
  }
}
// #endif
